fix ec validate input failing when policy has publicKey#3134
fix ec validate input failing when policy has publicKey#3134robnester-rh wants to merge 2 commits intoconforma:mainfrom
Conversation
When a policy spec includes a publicKey field, ec validate input would fail with 'no check options or sig verifier configured' because the signature verifier isn't initialized for input validation scenarios. Return the publicKey from the policy spec directly when SigVerifier is not initialized. Ref: conforma#1528 Ref: EC-1666 Co-authored-by: Claude Code <noreply@anthropic.com> Signed-off-by: Rob Nester <rnester@redhat.com>
Review Summary by QodoFix ec validate input with publicKey in policy spec
WalkthroughsDescription• Fix ec validate input failing when policy spec includes publicKey field • Return publicKey directly from policy spec when SigVerifier not initialized • Add test case for publicKey in policy configuration • Add acceptance test scenario for issue #1528 Diagramflowchart LR
A["Policy with publicKey"] -->|"SigVerifier not initialized"| B["PublicKeyPEM method"]
B -->|"Previous: error"| C["Failed validation"]
B -->|"Fixed: return publicKey"| D["Successful validation"]
File Changes1. internal/policy/policy.go
|
Code Review by Qodo
1.
|
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 4 files with indirect coverage changes 🚀 New features to boost your workflow:
|
When SigVerifier was not initialized, PublicKeyPEM() returned the policy's PublicKey verbatim, which could be non-PEM (e.g. a key ref). Validate with pem.Decode and return an error when not valid PEM so callers do not treat non-PEM data as PEM. Ref: conforma#1528 Ref: EC-1666 Co-authored-by: Claude Code <noreply@anthropic.com> Signed-off-by: Rob Nester <rnester@redhat.com>
|
/review |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
When a policy spec includes a publicKey field, ec validate input would fail with 'no check options or sig verifier configured' because the signature verifier isn't initialized for input validation scenarios.
Return the publicKey from the policy spec directly when SigVerifier is not initialized.
Ref: #1528
Ref: EC-1666